1 00:00:02,730 --> 00:00:11,250 ‫Welcome to lecture 11 here, I am going to show you how you can manipulate other documents from within 2 00:00:11,250 --> 00:00:14,140 ‫your API and what you are going to be doing here. 3 00:00:15,270 --> 00:00:16,830 ‫I have opened to the notes. 4 00:00:18,030 --> 00:00:19,110 ‫Right now it is empty. 5 00:00:19,500 --> 00:00:23,580 ‫And I also have my items table with two items, as you can see. 6 00:00:24,210 --> 00:00:28,860 ‫Not what you want to be doing is that we are going to be adding an item here and everything. 7 00:00:28,860 --> 00:00:29,790 ‫We add an item. 8 00:00:30,030 --> 00:00:36,060 ‫The system is going to trigger a note that is going to be associated in the note stable, telling whoever 9 00:00:36,060 --> 00:00:41,030 ‫is concerned that a new node has been a new item has been added to the document. 10 00:00:41,400 --> 00:00:44,310 ‫So what you can do after another has been added there. 11 00:00:44,310 --> 00:00:45,540 ‫You can send a message. 12 00:00:45,540 --> 00:00:49,240 ‫You can maybe basically you can do whatever you want to do with that. 13 00:00:49,530 --> 00:00:54,320 ‫So what you want to do here, you want to define a new function that's going to be good at what? 14 00:00:56,610 --> 00:01:05,340 ‫And then this function is going to have the function or the code that's going to be adding our our there's 15 00:01:05,340 --> 00:01:06,690 ‫going to be adding our nodes. 16 00:01:06,870 --> 00:01:17,840 ‫So what I want to do here is I want to do a very good at node, which I'm going to assign to frontier 17 00:01:17,850 --> 00:01:26,520 ‫dot db dot, dot, dot, dot, dot, dot, dot, get, because I want to get the document to get document 18 00:01:27,280 --> 00:01:31,350 ‫and then after I get the document course I'm going to tell it with the document I want to get. 19 00:01:31,410 --> 00:01:39,390 ‫Remember this, when you are doing our Esat you're going to supply the duct tape and the duct tape that 20 00:01:39,410 --> 00:01:42,720 ‫you want to get here is there and then duct tape. 21 00:01:42,840 --> 00:01:45,140 ‫Not sorry but they're not duct tape. 22 00:01:45,150 --> 00:01:50,580 ‫Remember we're starting a new node and then here you to apply the two things that we need to pass. 23 00:01:50,590 --> 00:01:56,580 ‫If you come to the duct tape and you try to add a note, we have a title and we have a public, I'm 24 00:01:56,580 --> 00:01:58,950 ‫going to assume that and we have the content. 25 00:01:58,980 --> 00:02:02,100 ‫So I'm going to be putting in the data and the content only. 26 00:02:02,940 --> 00:02:09,060 ‫So when I come back here, I have title that of this one. 27 00:02:09,060 --> 00:02:14,430 ‫I'm going to have to call it for now, but I'm going to show you how to do how to make it dynamic so 28 00:02:14,430 --> 00:02:20,460 ‫that it has the contents of whatever, whatever, whatever item that has been added. 29 00:02:21,090 --> 00:02:24,180 ‫And then we have here content. 30 00:02:24,690 --> 00:02:31,320 ‫And again, I'm going to go to this let me see the content for I to go to something like that. 31 00:02:31,890 --> 00:02:35,320 ‫And then here we're going to see Datafolha. 32 00:02:36,410 --> 00:02:37,610 ‫No, something like that. 33 00:02:37,660 --> 00:02:37,990 ‫OK. 34 00:02:39,820 --> 00:02:42,720 ‫So why is this one complaining, because we do not have accommodation. 35 00:02:43,750 --> 00:02:44,210 ‫All right. 36 00:02:44,530 --> 00:02:51,610 ‫And then remember what we are doing the year after this is to delete the addnode dot. 37 00:02:51,880 --> 00:02:57,610 ‫What do we want to do here is addnode dot insert, I hope you guessed it. 38 00:02:58,180 --> 00:03:04,180 ‫And then after that you're going to do Frappier dot the dot com it. 39 00:03:05,460 --> 00:03:09,550 ‫OK, now this one's you do not need to wait listed. 40 00:03:09,820 --> 00:03:15,760 ‫You do not need to to give it to give it to call it from from from our postman. 41 00:03:16,140 --> 00:03:18,490 ‫Remember you went to this one is not going to be called. 42 00:03:18,490 --> 00:03:21,310 ‫Actually the users are not going even to know that this has happened. 43 00:03:21,640 --> 00:03:25,920 ‫It is going to happen within within the European application itself. 44 00:03:26,320 --> 00:03:33,070 ‫So what you want to do, this function that we have here, we are going to call it inside of the add 45 00:03:33,070 --> 00:03:39,120 ‫item just after before we do the return, we are going to call that function. 46 00:03:39,130 --> 00:03:45,520 ‫So let me call it and add new node. 47 00:03:46,750 --> 00:03:50,920 ‫And remember, this one is not known to me to call this add new node. 48 00:03:51,160 --> 00:03:52,480 ‫So that is different from this. 49 00:03:52,500 --> 00:03:55,480 ‫OK, addNode, the function itself is not great. 50 00:03:55,930 --> 00:03:59,050 ‫So we can go ahead now and try to add a new item. 51 00:03:59,050 --> 00:04:04,480 ‫And all they expect is that after I have added a new item, it is going to add the item and then call 52 00:04:04,480 --> 00:04:07,960 ‫this function and then return with this function is going to be called. 53 00:04:08,350 --> 00:04:12,930 ‫It is going to come down here and create a new node in it into our database. 54 00:04:12,940 --> 00:04:17,940 ‫Lets see what happens here in the U.S. we have nothing and in the items we have to add them. 55 00:04:17,950 --> 00:04:22,960 ‫So at the end, we want after we have got it, one three items here in the note here and see whether 56 00:04:22,960 --> 00:04:23,640 ‫that happens. 57 00:04:23,650 --> 00:04:28,240 ‫So go back to our API to add an item. 58 00:04:28,660 --> 00:04:31,690 ‫We can add an item called X, X, X, no problem. 59 00:04:32,050 --> 00:04:34,930 ‫Send it and we get a success here. 60 00:04:35,320 --> 00:04:40,300 ‫So that means we should have an item here, which we have data for our note. 61 00:04:40,690 --> 00:04:45,900 ‫And here is would have another item added. 62 00:04:45,910 --> 00:04:47,200 ‫Perfect, not once. 63 00:04:47,440 --> 00:04:47,860 ‫Great. 64 00:04:48,250 --> 00:04:53,380 ‫So what we have done ideally is we have written a function with the title and the content and then we 65 00:04:53,380 --> 00:04:58,910 ‫have called this function inside of our auditing function. 66 00:05:00,280 --> 00:05:04,780 ‫Now what if we need this thing to be dynamic such that it details whoever is concerned? 67 00:05:04,780 --> 00:05:06,850 ‫Maybe is the director of this company. 68 00:05:06,850 --> 00:05:09,250 ‫They are imaginary company or whatever. 69 00:05:09,460 --> 00:05:10,530 ‫There's this directive. 70 00:05:10,860 --> 00:05:13,800 ‫A new item with this name has been added to the to the design. 71 00:05:13,810 --> 00:05:20,770 ‫Because what we do we do here is that you're going to hear the name and maybe the groups, what we tell 72 00:05:20,770 --> 00:05:23,140 ‫them also, which will be the has been added. 73 00:05:24,010 --> 00:05:30,160 ‫And then here we are going to do I can just compose to to what it was here, what is called title. 74 00:05:30,160 --> 00:05:42,640 ‫And this is going to be a formatted string and sing sing something like in to to name B has been added 75 00:05:43,240 --> 00:05:45,460 ‫to items OK. 76 00:05:48,020 --> 00:05:48,770 ‫And, of course. 77 00:06:03,730 --> 00:06:07,800 ‫I am still only 78 00:06:10,980 --> 00:06:16,410 ‫there is only this one is complaining is because we did not receive the items we need again here to 79 00:06:16,410 --> 00:06:18,460 ‫receive the item and the group. 80 00:06:18,810 --> 00:06:23,880 ‫So this one I stopped complaining to have something like name has been added to items. 81 00:06:24,090 --> 00:06:28,050 ‫And then we have the content and the content is going to be a formatted string. 82 00:06:28,860 --> 00:06:32,090 ‫Seeing something like what we put, you can put anything. 83 00:06:32,100 --> 00:06:43,290 ‫I can see our new item with with the with the name, with the name name 84 00:06:45,630 --> 00:06:59,790 ‫has being added to the group, to the baby group, to their products, to products and maybe something 85 00:06:59,790 --> 00:07:00,580 ‫like two products. 86 00:07:00,600 --> 00:07:02,300 ‫OK, that's it. 87 00:07:02,370 --> 00:07:06,180 ‫So this these two what we are going to be buzzing here. 88 00:07:06,190 --> 00:07:13,560 ‫So now I can remove this and massively piece that and then the title is going to come to the title place. 89 00:07:13,560 --> 00:07:15,800 ‫So we have the title and then we have that. 90 00:07:16,140 --> 00:07:20,610 ‫So now and we call this function, we expect this thing to be a little bit more beautiful because it 91 00:07:20,630 --> 00:07:25,780 ‫is going to give us these messages, these messages that we can we can relate with. 92 00:07:26,220 --> 00:07:36,090 ‫So let me go here and go this y y y y and then I'm going to say this is something like whichever call 93 00:07:36,160 --> 00:07:40,740 ‫this second and then I remove that and send it. 94 00:07:41,160 --> 00:07:42,780 ‫And we have a success message here. 95 00:07:42,790 --> 00:07:44,730 ‫So it looks like we have some success. 96 00:07:45,220 --> 00:07:47,520 ‫It must be successfully inserted. 97 00:07:47,910 --> 00:07:50,040 ‫So they come here, reload. 98 00:07:50,190 --> 00:07:57,100 ‫We see second item code, second item, second item, second has been added. 99 00:07:57,170 --> 00:07:59,370 ‫OK, is that how you have called it. 100 00:07:59,910 --> 00:08:01,950 ‫You have called it second Ippei. 101 00:08:01,950 --> 00:08:02,510 ‫Their second. 102 00:08:02,520 --> 00:08:02,820 ‫Yeah. 103 00:08:02,820 --> 00:08:04,110 ‫Something like the second item. 104 00:08:04,740 --> 00:08:05,300 ‫The second. 105 00:08:05,610 --> 00:08:11,940 ‫So let me go to this test item so that we know what we call it. 106 00:08:11,940 --> 00:08:16,230 ‫Bread, bread, some like bread, OK, in products. 107 00:08:16,710 --> 00:08:18,630 ‫So it's because completely because of this. 108 00:08:18,630 --> 00:08:23,940 ‫So we need to change this, maybe to Z then we go and send it in. 109 00:08:23,940 --> 00:08:24,900 ‫Yes, it's successful. 110 00:08:25,260 --> 00:08:29,910 ‫And now here in the notes we have bread has been added to items beautiful. 111 00:08:30,180 --> 00:08:34,800 ‫And when you open it, it is is our new item with the name bread has been added to products. 112 00:08:34,800 --> 00:08:37,430 ‫You see that has come from our API. 113 00:08:38,070 --> 00:08:45,300 ‫So now this is being called everything that we add a new item, we add a new item it because this function, 114 00:08:45,480 --> 00:08:48,990 ‫it passes the two parameters, that is the name on the group. 115 00:08:49,230 --> 00:08:53,280 ‫And then when it comes here at the Prince, this is the add another note. 116 00:08:53,490 --> 00:08:59,340 ‫And now here you can be able to do any other thing like slenderness, send under notification and everything 117 00:08:59,340 --> 00:09:00,450 ‫else that you need to do here. 118 00:09:00,630 --> 00:09:01,350 ‫It's up to you. 119 00:09:04,410 --> 00:09:09,720 ‫Thank you so much for giving me an opportunity to try new ERP next API. 120 00:09:10,230 --> 00:09:14,100 ‫I am hopeful that this series has made you into a developer that you want to be. 121 00:09:14,490 --> 00:09:20,040 ‫I am also hopeful that you can now write your own APIs, you can customize applications and you are 122 00:09:20,040 --> 00:09:22,620 ‫able to meet the needs of your clients. 123 00:09:23,100 --> 00:09:27,480 ‫If there is anything that you need me to help you with, please feel free to reach out to me. 124 00:09:27,870 --> 00:09:32,970 ‫Also, note that I am going to be producing other content on ERP next development. 125 00:09:33,120 --> 00:09:36,480 ‫And if you want to receive this content, please head over to my website. 126 00:09:36,480 --> 00:09:41,850 ‫Could really kind of come and leave your email everytime there is new content. 127 00:09:41,850 --> 00:09:44,670 ‫I'm going to be emailing you the details of the same. 128 00:09:45,090 --> 00:09:45,660 ‫Thank you. 129 00:09:45,660 --> 00:09:47,820 ‫And see you next time.